package cn.cttic.base.api.domain.bo;

import cn.cttic.base.api.domain.BaseDevice;
import cn.cttic.common.mybatis.core.domain.BaseEntity;
import cn.cttic.common.core.validate.AddGroup;
import cn.cttic.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import util.RegexpUtils;

import java.math.BigDecimal;

/**
 * 设备型号业务对象 base_device
 *
 * @author TImes.Studio
 * @date 2024-09-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BaseDevice.class, reverseConvertGenerate = false)
public class BaseDeviceBo extends BaseEntity {

    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { EditGroup.class })
    private String id;

    /**
     * 设备名称
     */
    @NotBlank(message = "设备名称不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 50, message = "设备名称不能超过50字符", groups = { AddGroup.class, EditGroup.class })
    private String deviceName;

    /**
     * 设备型号
     */
    @NotBlank(message = "设备型号不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 20, message = "设备名称不能超过50字符", groups = { AddGroup.class, EditGroup.class })
    private String deviceModel;

    /**
     * 设备价格
     */
    @DecimalMin(value = "0.0", message = "设备价格最小为0.0元", groups = { AddGroup.class, EditGroup.class })
    @DecimalMax(value = "999999.99", message = "设备价格最小为999999.99元", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal devicePrice;

    /**
     * 设备大小
     */
    @NotBlank(message = "设备大小不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 20, message = "设备大小不能超过20字符", groups = { AddGroup.class, EditGroup.class })
    private String deviceSize;

    /**
     * 设备海报
     */
    @NotBlank(message = "设备海报不能为空", groups = { AddGroup.class, EditGroup.class })
    private String devicePoster;

    /**
     * 设备缩略图
     */
    @NotBlank(message = "设备缩略图不能为空", groups = { AddGroup.class, EditGroup.class })
    private String deviceThumbnail;

    /**
     * 设备库存数量
     */
    @NotNull(message = "设备库存数量不能为空", groups = { AddGroup.class, EditGroup.class })
    @Min(value = 0, message = "设备库存最小为0", groups = { AddGroup.class, EditGroup.class })
    @Max(value = 999999, message = "设备库存最大为999999", groups = { AddGroup.class, EditGroup.class })
    private Integer deviceStockCount;

    /**
     * 设备描述
     */
    private String deviceDescription;


}
